import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "../home/Home.vue";

Vue.use(VueRouter)


const routes = [
  {
    /**
     * path: 路径为 / 时触发该路由规则
     * name: 路由的 name 为 Home
     * component: 触发路由时加载 `Home` 组件
     */
    path: "/",
    name: "vue",
    component: Home,
  },
];

const router = new VueRouter({
  mode: 'history',
  // 为微应用路由加上前缀，如果不加微应用路由切换会有问题
  base: window.__POWERED_BY_QIANKUN__ ? '/vueRule/' : process.env.BASE_URL,
  routes
})

export default router